/**
 * @Aurhor 把手给我
 * @Date 2022/6/24 20:02
 * @Version 1.0
 * 商品id生成类
 **/
package com.ft.utils;

import java.time.LocalDateTime;
import java.util.Random;

public class CommodityByID {
    //生成10位数的id
    public static int createID(){
        int number = 0;
        LocalDateTime localTime = LocalDateTime.now();
        String a = String.valueOf(localTime.getYear());
        Random r = new Random();
        a += r.nextInt(100);
        a += localTime.getDayOfMonth();
        a += r.nextInt(10);
        a += localTime.getMonthValue();
        return Integer.parseInt(a);
    }
}
